package com.aos.demo.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
@Slf4j
@Api(value = "接口控制器", tags = {"接口"})
public class TestController {
    @Value("${version}")
    String version;

    /**
     * 获取版本号
     * @return
     */
    @ApiOperation(value = "获取版本号", notes = "获取配置文件中的版本号")
    @GetMapping(value = "/version")
    public String getVersion(){
        log.info("开始调用方法！");
        return version;
    }
}
